﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;

namespace ChuanPlus
{
    public class Users : XPLiteObject
    {
        //======== TAO LIEN KET =================            
          
           

        //======== END TAO LIEN KET =============

        int fUserID;
        [Key(true)]
        public int UserID
        {
            get { return fUserID; }
            set { SetPropertyValue<int>("UserID", ref fUserID, value); }
        }
        string fUsername;
        [Size(20)]
        public string Username
        {
            get { return fUsername; }
            set { SetPropertyValue<string>("Username", ref fUsername, value); }
        }
        string fPassword;
        [Size(20)]
        public string Password
        {
            get { return fPassword; }
            set { SetPropertyValue<string>("Password", ref fPassword, value); }
        }
        string fAccountName;
        [Size(20)]
        public string AccountName
        {
            get { return fAccountName; }
            set { SetPropertyValue<string>("AccountName", ref fAccountName, value); }
        }
        bool fPermission;
        public bool Permission
        {
            get { return fPermission; }
            set { SetPropertyValue<bool>("Permission", ref fPermission, value); }
        }
        bool fActive;
        public bool Active
        {
            get { return fActive; }
            set { SetPropertyValue<bool>("Active", ref fActive, value); }
        }
        public Users(Session session) : base(session) { }
        public Users() : base(Session.DefaultSession) { }
        public override void AfterConstruction() { base.AfterConstruction(); }
        public override string ToString()
        {
            return AccountName;
        }
        /// <summary>
        /// Initializes a new instance of the Users class.
        /// </summary>
        /// <param name="fUsername"></param>
        /// <param name="fPassword"></param>
        /// <param name="fAccountName"></param>
        /// <param name="fPermission"></param>
        /// <param name="fActive"></param>
        public Users(string fUsername, string fPassword, string fAccountName, bool fPermission, bool fActive)
        {
            this.fUsername = fUsername;
            this.fPassword = fPassword;
            this.fAccountName = fAccountName;
            this.fPermission = fPermission;
            this.fActive = fActive;
        }
    }
}
